package com.excilys.utils;

import org.springframework.security.core.context.SecurityContextHolder;

import com.excilys.model.User;

/**
 * Static methods for users.
 * 
 * @author excilys dev : SC
 * 
 */

public class UserUtils {

	/**
	 * Return current connected User.
	 * 
	 */
	public static User getConnectedUser() {
		return (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
	}
}
